<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 

<h:head></h:head> 
<body> 
	<ui:composition template="../../template.xhtml">

            
            <ui:define name="content">
                <h:form >
					<p:panel header="Modifica volo">
							<h:panelGrid columns="3">
								<h:outputLabel for="company">Compagnia</h:outputLabel>
						        <h:inputText id="company" value="#{flightBackend.current.company}" required="true"></h:inputText>
						        <br />
						        <h:outputLabel for="departure_place">Luogo Partenza</h:outputLabel>
						        <h:selectOneMenu id="departure_place"
							                     value="#{flightBackend.current.place.name}">
							        <f:selectItems value="#{util.getPlaceListOptions()}" />
							    </h:selectOneMenu>
						        <br />
						        <h:outputLabel for="arrival_place">Luogo Arrivo</h:outputLabel>
						        <h:selectOneMenu id="arrival_place"
							                     value="#{flightBackend.current.product.place.name}">
							        <f:selectItems value="#{util.getPlaceListOptions()}" />
							    </h:selectOneMenu>
						        <br />
						        <h:outputLabel for="departure_date">Data di Partenza</h:outputLabel>
						        <h:inputText id="departure_date" value="#{flightBackend.current.departureDate}" required="true" styleClass="datepicker">
						        	<f:convertDateTime pattern="dd/MM/yyyy"/>  
						        </h:inputText>
						        <br />
						        <h:outputLabel for="arrival_Date">Data di Ritorno</h:outputLabel>
						        <h:inputText id="arriva_date" value="#{flightBackend.current.arrivalDate}" required="true" styleClass="datepicker">
						        	<f:convertDateTime pattern="dd/MM/yyyy"/>  
						        </h:inputText>
						        <br />
						        <h:outputLabel for="price">Prezzo(&euro;)</h:outputLabel>
						        <h:inputText id="price" value="#{flightBackend.current.product.price}" required="true"></h:inputText>
						        <br />
						        
					        	<h:commandButton value="Modifica Volo" action="#{flightBackend.update()}" styleClass="btn btn-default"/>
				
							</h:panelGrid>
					</p:panel>
				</h:form>
                
			</ui:define>
        </ui:composition>
</body> 
</html>
